# Maintainer: Alexey Pavlov <alexpux@gmail.com>

pkgname=diffutils
pkgver=3.3
pkgrel=3
pkgdesc="Utility programs used for creating patch files"
arch=('i686' 'x86_64')
url="http://www.gnu.org/software/diffutils"
license=('GPL3')
groups=('base-devel')
depends=('msys2-runtime' 'sh')
install=diffutils.install
source=(ftp://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${pkgver}.tar.xz{,.sig}
        diffutils-3.3-msys2.patch)
md5sums=('99180208ec2a82ce71f55b0d7389f1b3'
         'SKIP'
         '4e0f74c2a7968d1a7ad4a39b525dbd1c')

prepare() {
  cd ${srcdir}/${pkgname}-${pkgver}
  patch -p1 -i ${srcdir}/diffutils-3.3-msys2.patch

  autoreconf -fi
}

build() {
  cd ${srcdir}/${pkgname}-${pkgver}
  ./configure --build=${CHOST} \
    --prefix=/usr \
    --without-libiconv-prefix \
    --without-libintl-prefix
  make
}

check() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make check
}

package() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install
}
